﻿<%@ Import Namespace="ASPItalia.ModelVirtualCasting.Web.Models" %>
<%@ Import Namespace="ASPItalia.ModelVirtualCasting.Web.Utils" %>

<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<HomepageViewModel>" MasterPageFile="~/Views/Shared/Site.Mobile.Master"
    Title="Home page" %>

<asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server">
    <h1>ModelVC</h1>
    <div data-role="navbar">
        <ul>
            <li><a href="#news" data-icon="info">News</a></li>
            <li><a href="#" data-icon="home">About</a></li>
            <li><a href="#" data-icon="star">Login</a></li>
        </ul>
    </div>
</asp:Content>
<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
    <ul data-role="listview" data-theme="a">
        <% foreach (var theModel in this.Model.Models)
           { %>
        <li><a href='<%= Html.GetUrl("Profile", "Person", "Profile", new { nickname = theModel.NickName, disableAjax=true}) %>'>
            <img src="<%= theModel.ImageUrl.ToThumbnailAbsoluteUrl() %>" />
            <h3>
                <%= theModel.NickName %>
            </h3>
            <p>
                <%= theModel.CountryAndAge %></p>
        </a></li>
        <%} %>
    </ul>
</asp:Content>
<asp:Content runat="server" ID="optional" ContentPlaceHolderID="OptionalContent">
    <div data-role="page" id="news">
        <div data-role="header">
            <h1>
                News</h1>
        </div>
        <div data-role="content">
            <ul data-role="listview">
                <% foreach (var news in this.Model.News)
                   {%>
                <li><a href='<%= Url.Content("~/") %>'>
                    <h3>
                        <%: news.NewsTitle %></h3>
                    <p>
                        <%: news.NewsText.RemoveHtml().Truncate(80) %></p>
                </a></li>
                <% } %>
            </ul>
        </div>
        <div data-role="footer">
            <p>
                Powered by <a href="http://www.5dlabs.it/">5DLabs.it</a> &amp; <a href="http://www.aspitalia.com/">
                    ASPItalia.com</a></p>
        </div>
    </div>
</asp:Content>
